﻿using IBll;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace WebApi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class UserMagerController : ControllerBase, IUserMagerbLL
    {
         public UserMagerController(IUserMagerbLL bll)
        {
            Bll = bll;
        }

        public IUserMagerbLL Bll { get; }

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="name">用户名</param>
        /// <param name="pwd">密码</param>
        /// <returns>通过用户名密码登录</returns>
        /// 
        [HttpGet]
        public UserMager Loing(string name, string pwd)
        {
            try//异常处理
            {
                 return Bll.Loing  (name, pwd);
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
